home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
oasis
/
ossxmpls.lha
/
examples
/
hanoi.d
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1992-03-25
|
236 b
|
15 lines
class hanoi {
method:
public main ().
private han (int N, A, B, C).
}
hanoi {
main() |- han(20,1,2,3).
han(N',_,_,_) :- N<=0.
han(N',A',B',C') |-
han(N-1,A,C,B);
han(N-1,C,B,A).
}